package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import lombok.Data;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @author xsx
 * @version 1.0
 * @date 2022/10/12 11:31
 */
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_production_facility_video")
@SQLDelete(sql = "update wwyt_bp_production_facility_video set delete_flag = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_production_facility_video set delete_flag = '1' where id= ?")
@Where(clause = "delete_flag = '0'")
@Proxy(lazy = false)
@Data
public class BpProductionFacilityVideo implements java.io.Serializable {

    // columns START
    // ID
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    private Long id;

    //监控视频ID(wwyt_bp_system_video表)
    @Column(name = "system_video_id")
    private Long systemVideoId;

    //设备装置ID(wwyt_bp_production_facility表)
    @Column(name = "device_facility_id")
    private Long deviceFacilityId;

    // 创建人
    @Column(name = "create_by")
    private Long createBy;
    // 创建时间
    @Column(name = "create_time")
    private java.util.Date createTime;
    // 更新人
    @Column(name = "update_by")
    private Long updateBy;
    // 更新时间
    @Column(name = "update_time")
    private java.util.Date updateTime;
    // 删除标记
    @Column(name = "delete_flag")
    private String deleteFlag;
    // 租户ID
    @Column(name = "tenent_id")
    private Long tenentId;
    // 组织机构代码
    @Column(name = "org_code")
    private String orgCode;

}
